package com.koron.order.LineHomepage.bean.VO;

import com.koron.bean.base.BaseBean;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;

/**
 * @ClassName: ReportGenerationVO
 * @Description:
 * @Date: 2023/2/21
 * @Author: 李一辰
 * @Version: 1.0
 **/
@Data
public class ReportGenerationVO extends BaseBean {
    @ApiModelProperty("主键id")
    private String id;

    @ApiModelProperty("设备id")
    private String equipmentId;

    @ApiModelProperty("设备名称")
    private String equipmentName;
    @ApiModelProperty("跳闸次数")
    private Integer tripTimes;

    /**
     * 线路停电检修次数
     */
    @ApiModelProperty("线路停电检修次数-总次数")
    private Integer lineTotal;
    @ApiModelProperty("线路停电检修次数-计划停电次数")
    private Integer lineCut;
    @ApiModelProperty("线路停电检修次数-非计划停电次数")
    private Integer lineNonCut;

    /**
     * 缺陷新发现量
     */
    @ApiModelProperty("缺陷新发现量-总缺陷数")
    private  Integer defectNew;
    @ApiModelProperty("缺陷新发现量-停电处理")
    private Integer defect00New;
    @ApiModelProperty("缺陷新发现量-非停电处理")
    private Integer defect01New;

    /**
     * 上月缺陷总数
     */
    @ApiModelProperty("上月缺陷-总缺陷数")
    private Integer defectTotalLast;

    @ApiModelProperty("上月缺陷-停电处理")
    private Integer defectLast00;

    @ApiModelProperty("上月缺陷-非停电处理")
    private Integer defectLast01;

    /**
     * 消缺情况统计
     */
    @ApiModelProperty("消缺总数")
    private Integer defectTotal;
    @ApiModelProperty("消缺总数-停电处理")
    private Integer defect00;
    @ApiModelProperty("消缺总数-非停电处理")
    private Integer defect01;

    /**
     * 本月缺陷总数
     */
    @ApiModelProperty("本月缺陷总数-总缺陷数")
    private Integer defectTotalThis;
    @ApiModelProperty("本月缺陷总数-停电处理")
    private Integer defectThis00;
    @ApiModelProperty("本月缺陷总数-非停电处理")
    private Integer defectThis01;

    @ApiModelProperty("线路运行评价")
    private String evaluate;
    @ApiModelProperty("备注")
    private String remark;


    @ApiModelProperty("记录时间")
    private Date recordingTime;

    @ApiModelProperty("记录标识,如月份一致，数据进行更新替换")
    private String recordFlag;

    public String getRecordFlag() {
        return recordFlag;
    }

    public void setRecordFlag() {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
        simpleDateFormat.setTimeZone((TimeZone.getTimeZone("Asia/Shanghai")));
        String format = simpleDateFormat.format(this.recordingTime);
        String substring = format.substring(0,7);
        this.recordFlag = this.equipmentName+substring;
    }

    public ReportGenerationVO() {
        this.tripTimes = 0;
        this.lineTotal = 0;
        this.lineCut = 0;
        this.lineNonCut = 0;
        this.defectNew = 0;
        this.defect00New = 0;
        this.defect01New = 0;
        this.defectTotalLast = 0;
        this.defectLast00 = 0;
        this.defectLast01 = 0;
        this.defectTotal = 0;
        this.defect00 = 0;
        this.defect01 = 0;
        this.defectTotalThis = 0;
        this.defectThis00 = 0;
        this.defectThis01 = 0;
    }
}
